package com.btpj.shop.dto.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * category 商品分类参数
 *
 * @author BTPJ
 */
@ApiModel("商品分类参数")
@Data
public class CategoryParam implements Serializable {
    @ApiModelProperty("分类级别（1：一级分类、2：二级分类）")
    @NotNull
    private Byte level;

    @ApiModelProperty("父类别ID")
    private Long parentId;

    @ApiModelProperty("名称")
    @NotBlank
    @Length(min = 1, max = 20, message = "商品分类名称必须包含1～20个字符")
    private String name;

    @ApiModelProperty("排序值（值越大越靠前）")
    private Integer sort;

    private static final long serialVersionUID = 1L;
}